package main

import (
	"context"
	"dubbo.apache.org/dubbo-go/v3/client"
	_ "dubbo.apache.org/dubbo-go/v3/imports"
	"github.com/dubbogo/gost/log/logger"
	myprint "github.com/yourusername/dubbo-go-demo/print"
	greet "github.com/yourusername/dubbo-go-demo/proto" // 使用 greet 作为包别名
)

func main() {
	myprint.Print()
	cli, err := client.NewClient(
		client.WithClientURL("tri://192.168.5.36:20000"),
	)
	if err != nil {
		panic(err)
	}

	svc, err := greet.NewGreetService(cli)
	if err != nil {
		panic(err)
	}

	resp, err := svc.Greet(context.Background(), &greet.GreetRequest{Name: "world"})
	if err != nil {
		logger.Error(err)
	}
	logger.Infof("Greet response: %s", resp.Greeting)
}
